package Server.Game;

import Server.Sessions.OutboundMessages;
import shared.Messages.TurnMessage;

public class TurnController extends Thread{

	OutboundMessages outQueue;
	int turnPlayerId = 0;
	int GameNo;
	
	public TurnController(OutboundMessages outQueue, int GameNo) {
		this.outQueue = outQueue;
		this.GameNo = GameNo;
	}
	
	public int nextTurn(){
		turnPlayerId++;
		if(turnPlayerId >= 3){
			turnPlayerId = 1;
		}
		outQueue.addMessage(new TurnMessage(turnPlayerId, GameNo));
		
		return turnPlayerId;
	}
}
